<body>

	<div class="admin-biaogelist">
		<div class="listbiaoti am-cf">
			<ul class="am-icon-flag on">销售列表</ul>
			<dl class="am-icon-home" style="float: right;">当前位置： 首页 > <a href="#">销售列表</a></dl>
		</div>
		<div class="fbneirong">
			<form class="am-form am-g">



                <div class="searchbox">
                    <!--  <p  class="allmomey" style="margin-left: 20px; float: left">
                          今日任务总本金：0
                      </p>-->


                    <div class="searchbox_box">
                        <div  class="searchbox_text"> 开始时间：</div>
                        <div  class="searchbox_input"> <input type="text" class="datapick datapick1"   name="date1"> </div>
                    </div>

                    <div class="searchbox_box">
                        <div  class="searchbox_text"> 结束时间：</div>
                        <div  class="searchbox_input"><input type="text"   name="date2" class="datapick datapick2" > </div>
                    </div>



                    <div class="searchbox_box">
                        <div  class="searchbox_text"> 推荐人用户名：</div>
                        <div  class="searchbox_input"><input type="text" name="username" > </div>
                    </div>

                    <div class="searchbox_box">
                        <div  class="searchbox_text"> 被推荐人：</div>
                        <div  class="searchbox_input"><input type="text" name="Recommended" > </div>
                    </div>


                    <div class="searchbox_box">
                        <div class="search_button  search  am-btn am-btn-secondary "> <img src="<?php echo base_url();?>/public/assets/image/chazhao.png">查询 </div>
                    </div>



                    <!--   <p style=" float: left" > <a   style="margin-left: 20px;" class="am-btn am-btn-secondary am-radius excelout"  href="<?php /*echo base_url()."/Customer/businesspaylogexcel/0/0/0"*/?>">导出</a></p>-->


                </div>





				<table width="100%" class="am-table am-table-bordered am-table-radius am-table-striped">
					<thead>
						<tr class="am-success">
                            <th class="table-type">ID</th>
                            <th class="table-type">用户ID</th>
							<th class="table-type">用户名</th>
							<th class="table-type">被推荐人ID</th>
                            <th class="table-type">被推荐人用户名</th>
							<th class="table-type">添加时间</th>
						</tr>
                    <tbody class="impowdith">
                    </tbody>
					</thead>
				</table>
                <div id="Pagination" style="margin:20px auto" style="display:none"></div>
			</form>
		</div>
	</div>
</body>

</div>



<script>




   var salerlist=$("#salerlist").html();


    var on_request=false;
    var page=1;



    $(".search").click(function () { page=1
        GetAllSaleList();
    });
   laydate.render({
       elem: '.datapick1'
   });
   laydate.render({
       elem: '.datapick2'
   });



   function setlisthtnml(data) {
        var html = "";
        if (data.list.length > 0) {
            $.each(data.list, function (key, value) {
                html = html +
                    '<tr>' +
                    '<td>' + value.id + '</td>\n' +
                    '<td>' + value.user_id + '</td>\n' +
                    '<td>' + value.username + '</td>\n' +
                    '<td>' + value.Recommended_id + '</td>\n' +
                    '<td>' + value.Recommended + '</td>\n' +
                    '<td>' + value.addtime + '</td>\n' +
                    '</tr>';
            });
            console.log(html)
            $(".impowdith").html(html);
            $('#Pagination').show();
        } else {
            html += '<li><div style="width:100%;text-align:center;">&nbsp暂无数据</div></li>';
            $(".impowdith").html(html);
            $('#Pagination').hide();
        }
    }

   GetAllSaleList();

    function GetAllSaleList() {
        var url = "<?php echo base_url(); ?>/Customer/GetSaleloglist";
        var username=$("input[name='username']").val();

        var date1=$("input[name='date1']").val();
        var date2=$("input[name='date2']").val();

        var postdata = {
            'page': page,
            'eapge': 15,
            'date1': date1,
            'date2': date2,
            'username': username

        };
        $.post(url, postdata, function (data) {
            on_request = false;
            setlisthtnml(data);
            setPagination("Pagination", data.count, page, data.epage, function (clickPage) {
                page = parseInt(clickPage) + 1;
                GetAllSaleList();
            });
        }, 'json');

    }






</script>

<div class="foods">
    <ul>
        版权所有@2015.
    </ul>
    <dl>
        <a href="" title="返回头部" class="am-icon-btn am-icon-arrow-up"></a>
    </dl>
</div>




</div>

</div>




</div>


<!--<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>-->
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="<?php echo base_url() . 'public/business/'; ?>assets/js/polyfill/rem.min.js"></script>
<script src="<?php echo base_url() . 'public/business/'; ?>assets/js/polyfill/respond.min.js"></script>
<script src="<?php echo base_url() . 'public/business/'; ?>assets/js/amazeui.legacy.js"></script>


<!--[if (gte IE 9)|!(IE)]><!-->
<script src="<?php echo base_url() . 'public/business/'; ?>assets/js/amazeui.min.js"></script>
<!--<![endif]-->



</body>
</html>